const auth_url = 'https://172.35.0.2';   // 环境地址
const api_url = 'http://localhost:8077'; // 本地代理地址

const PROXY_CONFIG = [
  {
    context: [
      '/auth_login',
      '/auth',
      '/ems_dashboard_api/auth_login',
      '/ems_dashboard_api/static',
      '/ems_dashboard_api/auth/switch'
    ],
    target: auth_url,
    secure: false,
    pathRewrite: {
      '^/ecs/': '/ecs/',
      '^/ecas/': '/ecas/',
      '^/novnc/': '/novnc/',
      '^/static': '/static',
      '^/websockify/': '/websockify/'
    },
    changeOrigin: false,
    ws: true
  },
  {
    context: [
      // '/auth_login',
      // '/auth',
      '/ems_dashboard_api',
      '/api',
      '/multi_region_dashboard_api',

      '/ecs',
      '/ecas',
      '/ecms',
      '/static',
      '/novnc',
      '/ens/network/api',
      '/nova_dashboard_api',
      '/glance_dashboard_api',
      '/ecns-dashboard-api',
      '/devops_dashboard_api',
      '/dr_dashboard_api',
      '/cinder_dashboard_api',
      '/websockify',
      '/rest_api',
      '/alcubierre_dashboard_api',
      '/alcubierre_manul_api',
    ],
    target: api_url,
    secure: false,
    pathRewrite: {
      '^/ecs/': '/ecs/',
      '^/ecas/': '/ecas/',
      '^/novnc/': '/novnc/',
      '^/static': '/static',

      '^/websockify/': '/websockify/'
    },
    changeOrigin: false,
    ws: true
  }
];
module.exports = PROXY_CONFIG;
